<?php


namespace app\common\model;


use think\Db;
use think\Exception;
use think\Model;
use traits\model\SoftDelete;

class OrderFail extends Model
{

    // 表名
    protected $name = 'play_order_fail';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'datetime';
    protected $dateFormat = 'Y-m-d H:i:s';

    // 定义时间戳字段名
    protected $createTime = 'create_dt';
    protected $updateTime = 'update_dt';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        // 'status_text'
    ];

    public function getStatusList()
    {
        return ['0' => '未查看', '1' => '已查看'];
    }

    public function shop()
    {
        return $this->belongsTo('app\admin\model\Shop', 'shop_no', 'shop_no');
    }

    // public function getStatusTextAttr($value, $data)
    // {
    //     $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
    //     $list = $this->getStatusList();
    //     return isset($list[$value]) ? $list[$value] : '';
    // }
}